using System.Diagnostics.CodeAnalysis;
using Bookvar.ObjectModel;
using Bookvar.UI.Arrangers;

namespace Bookvar.UI.ViewModel
{
    internal partial class MindmapViewModel : ViewModelBase
    {
        private MindMap mindmap;
        private Topic selectedTopic;
        private ITopicConnector topicConnector;
        private TopicArranger topicArranger;

        #region Properties

        [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Used in bindings")]
        public MindMap Mindmap
        {
            get { return mindmap; }
            set { SetFieldValue("Mindmap", ref mindmap, value); }
        }

        [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Used in bindings")]
        public Topic SelectedTopic
        {
            get { return selectedTopic; }
            set { SetFieldValue( "SelectedTopic", ref selectedTopic, value ); }
        }

        [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Used in bindings")]
        public ITopicConnector TopicConnector
        {
            get { return topicConnector; }
            set { SetFieldValue( "TopicConnector", ref topicConnector, value ); }
        }

        [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Used in bindings")]
        public TopicArranger TopicArranger
        {
            get { return topicArranger; }
            set { SetFieldValue( "TopicArranger", ref topicArranger, value ); }
        }

        #endregion

        internal MindmapViewModel()
        {
        }

        protected override void InitializeCommands()
        {
            base.InitializeCommands();

            Commands.Add( new FocusSelectedTopicCommand( this ) );
            Commands.Add( new AddNewTopicCommand( this ) );
            Commands.Add( new AddNewSubTopicCommand( this ) );
            Commands.Add( new DeleteTopicCommand( this ) );
            Commands.Add( new AddNewFloatingCommand( this ) );
            Commands.Add( new AddIconCommand( this ) );
            Commands.Add( new AddImageCommand( this ) );
            Commands.Add( new AddVideoCommand( this ) );
            Commands.Add( new DeleteResourceCommand( this ) );
            Commands.Add( new BalanceMapCommand( this ) );
        }
    }
}